//index.js
//获取应用实例
var app = getApp();
Page({
  data: {
    book: {},
    evaluationList: [],
    bookNum: 0
  },

  goBookshelf: function(e) {
    wx.showToast({
      title: '书架数量',
    })
  },

  onLoad: function(e) {
   
    var that = this;
    wx.request({
      url: app.globalData.domain + '/api/book/detail',
      data: {
        id: e.id
      },
      success: function(res) {
        var selectSizeTemp = "";
        that.data.book = res.data.book;
        that.setData({
          book: res.data.book,
        });
        console.log(that.data.book.describe);
      }
    })
  },

  addBookshelf: function(e) {
          wx.showToast({
            title: '书架待开发',
          })
  },

  tobuy: function(e) {
    if (!wx.getStorageSync('token')) {
      wx.navigateTo({
        url: '/pages/login/index',
      })
    }
    wx.showToast({
      title: '借阅待开发'
    })
    return;
  }

})